/**
    package: learn-go
    filename: StrRandom
    author: diogo@gmail.com
    time: 2022/6/6 10:57
**/
package main

import (
	"fmt"
	"time"

	"gitee.com/diogoxiang/learn-go/example/StrRandom/approach8"
)

func main() {

	var str = approach8.RandStr(10)
	fmt.Println(str)

	var start = time.Now()

	// 生成10000 个 1ms
	s := make([]string, 0, 10000) // 预先设置 cap 值
	for i := 0; i < 10000; i++ {
		s = append(s, approach8.RandStr(10))
	}

	fmt.Println(s[:10])
	fmt.Println(time.Now().Sub(start))

}
